home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / uucp103d / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-02-04  |  64.9 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i046: uucp 1.03D - unix compatible uucp/mail/news system, Part02/16
  5. Message-ID: <11285@xanth.cs.odu.edu>
  6. Date: 4 Feb 90 02:29:28 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: overload!dillon (Matt Dillon)
  9. Lines: 2449
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12.  
  13. Submitted-by: overload!dillon (Matt Dillon)
  14. Posting-number: Volume 90, Issue 046
  15. Archive-name: unix/uucp-1.03d/part02
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 2 (of 16)."
  24. # Contents:  VERSION.DOC lib/.dmailrc lib/Aliases man/Aliases
  25. #   man/Assigns man/Security man/UPDATES man/UUClean man/UUSer
  26. #   man/UUdecode man/UUencode man/man s/.edrc src/MUtil/man.c
  27. #   src/MUtil/trimfile.c src/News060/Anews/mscan.c
  28. #   src/compress/uuencode.c src/dmail/DMakefile src/dmail/cond.c
  29. #   src/dmail/globals.c src/getty/passwd.c src/include/config.h
  30. #   src/lib/config.c src/lib/getpwnam.c src/lib/log.c
  31. #   src/sendmail/parse.c src/uucico/DMakefile src/uucico/sysdep.h
  32. #   src/uucico/uucp.h src/uucico/version.doc src/uuser/misc.c
  33. #   src/uuser/uuser.doc
  34. # Wrapped by tadguy@xanth on Sat Feb  3 20:50:58 1990
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. if test -f 'VERSION.DOC' -a "${1}" != "-c" ; then 
  37.   echo shar: Will not clobber existing file \"'VERSION.DOC'\"
  38. else
  39. echo shar: Extracting \"'VERSION.DOC'\" \(1265 characters\)
  40. sed "s/^X//" >'VERSION.DOC' <<'END_OF_FILE'
  41. X
  42. X
  43. X                VERSION.DOC
  44. X
  45. X                Matthew Dillon
  46. X                891 Regal Rd.
  47. X                Berkeley, Ca. 94708
  48. X
  49. X                pacbell.PacBell.COM!sorinc!overload!dillon
  50. X
  51. X    The version and sub version of most executables in the distribution may
  52. X    be retrieved by running the 'uident' program on the executable(s).
  53. X    Source directories contain (sporatically) Version.DOC files with
  54. X    remarks on sub-versions for specific executables.  This file contains
  55. X    overall remarks on the main version id.
  56. X
  57. X1.03D
  58. X
  59. X    slight changes to postnews (now uses DomainName)
  60. X
  61. X    Domains fixed (effects only people who use UULIB:Domain)
  62. X
  63. X    sendmail more intelligent about checking argv[0] to see
  64. X    if it is rmail (now works with WShell)
  65. X
  66. X    UUCP:LIB paths changed to UULIB:
  67. X
  68. X    uupoll no longer needs 'brun'
  69. X
  70. X    Problems.DOC file added
  71. X
  72. X1.02D
  73. X    stack warning in SlowSetup.DOC added (stack should be at least
  74. X    8192).    'Stack 8192' added to sample startup sequence.  RNews
  75. X    warning (RNews takes a huge amount of RAM currently) added.
  76. X
  77. X1.01D
  78. X    UUCP:LIB paths fixed to use UULIB:
  79. X
  80. X1.00D
  81. X    Initial Release 'D' series by Matthew Dillon, based on
  82. X    0.40, 0.50 and 0.60WPL series by William Loftus.
  83. X
  84. X0.60WPL
  85. X0.50WPL
  86. X0.40WPL
  87. X    UUCP release series for the Amiga by William Loftus, sub
  88. X    version changes not listed in this file.
  89. X
  90. X
  91. X
  92. X
  93. END_OF_FILE
  94. if test 1265 -ne `wc -c <'VERSION.DOC'`; then
  95.     echo shar: \"'VERSION.DOC'\" unpacked with wrong size!
  96. fi
  97. # end of 'VERSION.DOC'
  98. fi
  99. if test -f 'lib/.dmailrc' -a "${1}" != "-c" ; then 
  100.   echo shar: Will not clobber existing file \"'lib/.dmailrc'\"
  101. else
  102. echo shar: Extracting \"'lib/.dmailrc'\" \(1027 characters\)
  103. sed "s/^X//" >'lib/.dmailrc' <<'END_OF_FILE'
  104. X
  105. X#   .DMAILRC file
  106. X#
  107. X#   not very user friendly.  Some aliases may not apply, quick port
  108. X#   from UNIX.
  109. X
  110. Xset header  uulib:.signature
  111. Xset replyfields "Reply-To: Return-Path:"
  112. Xset _headchar :
  113. X
  114. X#   mail you send is archived by dmail
  115. Xset archive    uumail:mbox
  116. Xif !comlinemail
  117. Xalias qdt    "dt"
  118. X#   Warning: page mode doesn't work on Amiga's
  119. Xalias qdb    "db"
  120. Xalias noarch    "unset archive"
  121. Xalias arch    "set archive uumail:mbox"
  122. Xalias ls    "! ls"
  123. Xalias normal    "setlist -s 7 From 25 Subject 9 To 0 Cc 10 Date"
  124. Xalias page    set page more -p
  125. Xalias nopage    unset page
  126. Xalias spool    "g uumail:dillon uumail:mbox"
  127. Xalias mbox    "g uumail:mbox"
  128. Xalias g     "qswitch"
  129. Xalias kill    "%var sel Sub $var;d all;sel all"
  130. Xalias rem    "%var nobreak;_spage;set page remember $var;type;_rpage;breakok"
  131. Xalias _spage    "if page;set _page $page;endif"
  132. Xalias _rpage    "if _page;set page $_page;unset _page;else;unset page;endif"
  133. Xalias tech    "qswitch tech; sel News comp.sys.amiga.tech,comp.sys.amiga comp.sys.amiga,comp.sys.amiga.tech; d all; sel all"
  134. Xnormal
  135. X#page
  136. X#cd uucp:mail
  137. Xendif
  138. X
  139. END_OF_FILE
  140. if test 1027 -ne `wc -c <'lib/.dmailrc'`; then
  141.     echo shar: \"'lib/.dmailrc'\" unpacked with wrong size!
  142. fi
  143. # end of 'lib/.dmailrc'
  144. fi
  145. if test -f 'lib/Aliases' -a "${1}" != "-c" ; then 
  146.   echo shar: Will not clobber existing file \"'lib/Aliases'\"
  147. else
  148. echo shar: Extracting \"'lib/Aliases'\" \(1273 characters\)
  149. sed "s/^X//" >'lib/Aliases' <<'END_OF_FILE'
  150. X
  151. X#   SENDMAIL ALIASES.
  152. X#
  153. X# Alias for mailer daemon.  REFER TO MAN:Aliases for more information.
  154. X#
  155. X#   #    comment character (must be first char on line)
  156. X#   name: addr, addr, addr, addr,
  157. X#      addr, addr, addr, addr
  158. X#
  159. X#   addr can be (1) any path
  160. X#        (2) >file   (append to said file)
  161. X#        (3) <file   (include addresses from file, one per line)
  162. X#        (4) "|command"  (pipe through a command)
  163. X#        (5) \user   (if user is an alias this ignores the alias)
  164. X#
  165. X#   note that each addr must be comma delimited, and line continuation
  166. X#   depends on whether the last addr on the line has a comma after it.
  167. X
  168. XMAILER-DAEMON: postmaster
  169. X
  170. X# Following alias is required by the new mail protocol, RFC 822
  171. Xpostmaster: foo
  172. X
  173. X# Aliases to handle mail to msgs and news
  174. X
  175. X# Alias for uucp maintenance
  176. Xuucplist: root
  177. Xuucp: uucplist
  178. X
  179. X# System
  180. Xmanager: foo
  181. Xoperator: manager
  182. Xstaff: foo
  183. Xnobody:
  184. X
  185. X#
  186. X# smart-aleck aliases
  187. X#
  188. Xdaemon: manager
  189. Xlp: manager
  190. Xusrlimit: manager
  191. X
  192. X#
  193. X#   User
  194. X#
  195. X#   send mail for foo to foo and also archive it.
  196. X
  197. Xfoo: \foo, >uumail:mbox
  198. X
  199. Xfriend: fubar!friend
  200. X
  201. X# William P. Loftus
  202. Xwpl: PRC.Unisys.COM!wpl
  203. X
  204. X# Matt Dillon
  205. Xdillon: pacbell.PacBell.COM!sorinc!overload!dillon
  206. X
  207. X# Fred Fish, 1835 East Belmont Dr, Tempe, Arizona 85284
  208. X# 1-602-491-0048
  209. Xfish:    cs.utexas.edu!asuvax!mcdphx!estinc!fnf
  210. X
  211. END_OF_FILE
  212. if test 1273 -ne `wc -c <'lib/Aliases'`; then
  213.     echo shar: \"'lib/Aliases'\" unpacked with wrong size!
  214. fi
  215. # end of 'lib/Aliases'
  216. fi
  217. if test -f 'man/Aliases' -a "${1}" != "-c" ; then 
  218.   echo shar: Will not clobber existing file \"'man/Aliases'\"
  219. else
  220. echo shar: Extracting \"'man/Aliases'\" \(1960 characters\)
  221. sed "s/^X//" >'man/Aliases' <<'END_OF_FILE'
  222. X
  223. XNAME
  224. X    UULIB:Aliases
  225. X
  226. XDESCRIPTION
  227. X    UULIB:Aliases is a text file containing mail aliases.  There
  228. X    is no need to run newaliases after modifying this file (there
  229. X    is no newaliases program).    This file is scanned by sendmail
  230. X    for each item of incomming and outgoing email.
  231. X
  232. X    Each line in UULIB:Aliases may be either blank, have a '#'
  233. X    as the first character to indicate a comment, or begin an
  234. X    alias.  An alias consists of a name, colon, and list of
  235. X    items.  For example:
  236. X
  237. X    comiclovers:    charlie, ben, lucy, james
  238. X
  239. X    Multi-line aliases may be specified by a comma at the end of
  240. X    each line to be continued:
  241. X
  242. X    comiclovers:    charlie, ben,
  243. X            lucy, james
  244. X
  245. X    Note that the last line has no comma.  Each item in an alias
  246. X    may be:
  247. X
  248. X    (1) user        a local user name
  249. X    (2) \user       forces a local user name if the name is aliased
  250. X    (3) alias       another alias
  251. X    (4) path        some path
  252. X    (5) >file       append the mail item to some file
  253. X    (6) <file       load a further list of destinations from a
  254. X            file (one item per line)
  255. X    (7) |command    pipe mail item to a command with optional args
  256. X    (8) "|command args"
  257. X
  258. X    For example, if I want incomming mail to be posted to my mail box
  259. X    AND automatically appended to some archive file (and note here
  260. X    that I must use '\' to prevent an alias loop):
  261. X
  262. X    dillon: \dillon, >uumail:archive
  263. X
  264. X    items may point to other aliases (dillon is already an alias):
  265. X
  266. X    comiclovers:    dillon, fred
  267. X
  268. X    mail may be piped to a command, such as an automated vacation-response
  269. X    program:
  270. X
  271. X    dillon: \dillon, >uumail:archive, |vacation
  272. X
  273. XNEWSGROUPS
  274. X
  275. X    Newsgroups are difficult to implement with this Aliases
  276. X    implementation because the sender's address is NOT removed
  277. X    from the item list.
  278. X
  279. X    we hope to implement news propogation via a separate file and
  280. X    the rnews program.    When this is done, an alias will usually
  281. X    be required:
  282. X
  283. X    news:    |rnews
  284. X
  285. XFILES
  286. X
  287. X    uulib:Aliases
  288. X    uucp:c/sendmail
  289. X
  290. X
  291. END_OF_FILE
  292. if test 1960 -ne `wc -c <'man/Aliases'`; then
  293.     echo shar: \"'man/Aliases'\" unpacked with wrong size!
  294. fi
  295. # end of 'man/Aliases'
  296. fi
  297. if test -f 'man/Assigns' -a "${1}" != "-c" ; then 
  298.   echo shar: Will not clobber existing file \"'man/Assigns'\"
  299. else
  300. echo shar: Extracting \"'man/Assigns'\" \(1990 characters\)
  301. sed "s/^X//" >'man/Assigns' <<'END_OF_FILE'
  302. X
  303. X                ASSIGNMENTS
  304. X
  305. X    Startup-Sequence Assignments (examples).  Note, UUPUB: will in the
  306. X    future be used for 'public' uucp transfers.
  307. X
  308. X    Assign UUCP:    DF0:
  309. X    Assign UUSPOOL:    UUCP:Spool
  310. X    Assign UULIB:    UUCP:Lib
  311. X    Assign UUMAIL:    UUCP:Mail
  312. X    Assign UUNEWS:    UUCP:Mail/News
  313. X    Assign UUPUB:    UUCP:Pub
  314. X
  315. X    Assign Getty:    UUCP:Lib
  316. X
  317. X    UULIB:Config entries:
  318. X
  319. X    NodeName        The name by which you want to call your
  320. X                machine.  Suggested 7 chars max.
  321. X
  322. X    UserName        Your 'user' name. e.g. dillon.  This is
  323. X                where Mail, DMail, and From use as a
  324. X                default for your user name.
  325. X
  326. X    RealName        Your full name. e.g. Matthew Dillon.  Used
  327. X                by sendmail (which is run from Mail or
  328. X                DMail)
  329. X
  330. X    NewsFeed        Which remote machine should outgoing
  331. X                news be sent to?
  332. X
  333. X    Organization        Your organization, if any (for News)
  334. X
  335. X    Filter            Foreground filter program (to display a
  336. X                file).  Output expected to go through
  337. X                stdout.  Used by MAN if RFilter does not
  338. X                exist.
  339. X
  340. X    RFilter         Background filter program (that can be
  341. X                RUNd to display a file)
  342. X
  343. X    MailEditor        The editor DMail uses.
  344. X
  345. X    NewsEditor        The editor postnews uses
  346. X
  347. X    DomainName        The domain of your machine, usually .UUCP
  348. X                This is automatically tacked on to the
  349. X                mail headers when you mail out or mail
  350. X                is routed through your machine.
  351. X
  352. X    TimeZone        PST,PDT, etc... Currently only US timezones
  353. X                are implemented.  Used to calculate GMT
  354. X                time from local time for use in mail headers.
  355. X
  356. X    DefaultNode        Normally set to an immediately adjacent
  357. X                USENET node.  IF YOU CAN CONNECT TO MORE
  358. X                THAN ONE OTHER USENET NODE REFER TO
  359. X                MAN:DOMAINS FOR INFORMATION ON SELECTING
  360. X                WHICH NODE AN ADDRESS GETS ROUTED THROUGH.
  361. X
  362. X                Example:    'sorinc.UUCP' if I talk
  363. X                directly to sorinc.
  364. X
  365. X                You may also specify explicit paths
  366. X                as long as the very first machine is
  367. X                directly adjacent to you (you can call
  368. X                directly).
  369. X
  370. END_OF_FILE
  371. if test 1990 -ne `wc -c <'man/Assigns'`; then
  372.     echo shar: \"'man/Assigns'\" unpacked with wrong size!
  373. fi
  374. # end of 'man/Assigns'
  375. fi
  376. if test -f 'man/Security' -a "${1}" != "-c" ; then 
  377.   echo shar: Will not clobber existing file \"'man/Security'\"
  378. else
  379. echo shar: Extracting \"'man/Security'\" \(1178 characters\)
  380. sed "s/^X//" >'man/Security' <<'END_OF_FILE'
  381. X
  382. X
  383. XNAME
  384. X    UULIB:Security
  385. X
  386. XSYNOPSIS
  387. X    -
  388. X
  389. XDESCRIPTION
  390. X    The UULIB:Security file governs readability and writability
  391. X    of directories relative to remote uucp requests.  The UUSPOOL:
  392. X    directory is always readable and writable.
  393. X
  394. X    This prevents other nodes from examining or overwriting
  395. X    arbitrary files in your system.
  396. X
  397. X    The UUCICO program, which does the actual work downloading
  398. X    and uploading files, will check remote-requested paths
  399. X    against this file by comparing inodes (DOS Locks) and not
  400. X    by name.  The reason for this is simply that, on the Amiga,
  401. X    several different paths may refer to the same directory.
  402. X
  403. X            ---- Example Security file (this line not included) ---
  404. X
  405. X#   This file is used by UUCICO to determine the validity of requests.
  406. X#
  407. X#   The directories listed here are *allowed* directories for uucp
  408. X#   transfers.    The permissions field lists permissions
  409. X#            r    -readable
  410. X#            w    -writable
  411. X
  412. Xtmp:        rw
  413. Xuucp:c        r
  414. Xuucp:man    r
  415. XUUPUB:        rw
  416. X
  417. X# If you have a UUPUBW: assign that is *different* from UUPUB: then
  418. X# you might want to make UUPUB: readable only and UUPUBW: read-write.
  419. X
  420. X            ---- End of Example (this line not included) ---
  421. X
  422. XREFERENCES:
  423. X    UUCP, UUCICO
  424. X
  425. END_OF_FILE
  426. if test 1178 -ne `wc -c <'man/Security'`; then
  427.     echo shar: \"'man/Security'\" unpacked with wrong size!
  428. fi
  429. # end of 'man/Security'
  430. fi
  431. if test -f 'man/UPDATES' -a "${1}" != "-c" ; then 
  432.   echo shar: Will not clobber existing file \"'man/UPDATES'\"
  433. else
  434. echo shar: Extracting \"'man/UPDATES'\" \(1441 characters\)
  435. sed "s/^X//" >'man/UPDATES' <<'END_OF_FILE'
  436. X
  437. X This file is a listing of all the changes & fixes to UUCP & UseNet that are
  438. X *NOT* covered by the README file. For more details on changes please read
  439. X the source code(s).
  440. X
  441. X
  442. XDate         Programmer       Details
  443. X--------     ------------     --------------------------------------------------
  444. X09/22/88     Sneakers         Added a tail option to UULOG "-t".
  445. X
  446. X09/24/88     Sneakers         Tail option of UULOG was broken. It is now fixed.
  447. X
  448. X09/24/88     Sneakers         Rewrote 'MAIL' command.
  449. X                              Removed message header from user editable message.
  450. X                              Now gives a warning on ZERO byte messages & exits.
  451. X
  452. X09/30/88     Sneakers         Rewrote 'Pnews-x' commands.
  453. X                              Fixed the broken CopyMessage() routine.
  454. X                              Added Include() routine.    File to include [None]
  455. X                              Added CheckUser() routine.  [Send|List|Edit|Abort]
  456. X
  457. X10/04/88     Sneakers         Mail command was brain dead on multi addresses.
  458. X                              Fixed it, and it works great :-)
  459. X
  460. X10/07/88     Sneakers         Tail option of UULOG was 'still' broken when the
  461. X                              LOGFILE was < 10 lines. UULOG is now fixed. And
  462. X                              you have Joe Isuzu's word on it :-)
  463. X
  464. X10/02/88     Mike Schultz     Added support for nonbatched news articles to the
  465. X                              Rnews command.
  466. END_OF_FILE
  467. if test 1441 -ne `wc -c <'man/UPDATES'`; then
  468.     echo shar: \"'man/UPDATES'\" unpacked with wrong size!
  469. fi
  470. # end of 'man/UPDATES'
  471. fi
  472. if test -f 'man/UUClean' -a "${1}" != "-c" ; then 
  473.   echo shar: Will not clobber existing file \"'man/UUClean'\"
  474. else
  475. echo shar: Extracting \"'man/UUClean'\" \(1592 characters\)
  476. sed "s/^X//" >'man/UUClean' <<'END_OF_FILE'
  477. X
  478. XNAME
  479. X     uuclean - uucp spool directory clean-up
  480. X
  481. XSYNTAX
  482. X     uuclean [ option ] ...
  483. X
  484. XDESCRIPTION
  485. X     The uuclean command scans the spool directory for files with
  486. X     the specified prefix and deletes all those which are older
  487. X     than the specified number of hours.
  488. X
  489. XOPTIONS
  490. X     -ppre   Scan for files with pre as the file prefix.  Up to
  491. X             10 -p arguments may be specified.  A -p without any
  492. X             pre following will cause all files older than the
  493. X             specified time to be deleted.
  494. X
  495. X     -ntime  Delete all files whose age is more than time
  496. X             (default is 72 hours) and that have the specified
  497. X             pre as their file prefix.
  498. X
  499. X     -m      Send mail to the owner of the file when it is
  500. X             deleted.
  501. X
  502. X     -ssystem
  503. X             Delete files in all directories that are subdirec-
  504. X             tories of the per system spool directory that exists
  505. X             for system. If ALL is specified, then all system
  506. X             directories are processed.
  507. X
  508. X     -ddirectory
  509. X             Delete files that reside in the named directory. The
  510. X             -s option over rides the -d option.
  511. X
  512. X     This program will typically be started by cron. In earlier
  513. X     versions, a deleted work file (C.file) would result in
  514. X     mail to the owner of the work file, regardless of the -m
  515. X     option.  Now, notification of deleted work files is sent to
  516. X     the user ID "uucp".  If the -m option is used, mail is also
  517. X     sent to the owner.
  518. X
  519. XFILES
  520. X     UUCP:lib/uucp         directory with commands used by
  521. X                           uuclean internally
  522. X
  523. END_OF_FILE
  524. if test 1592 -ne `wc -c <'man/UUClean'`; then
  525.     echo shar: \"'man/UUClean'\" unpacked with wrong size!
  526. fi
  527. # end of 'man/UUClean'
  528. fi
  529. if test -f 'man/UUSer' -a "${1}" != "-c" ; then 
  530.   echo shar: Will not clobber existing file \"'man/UUSer'\"
  531. else
  532. echo shar: Extracting \"'man/UUSer'\" \(1492 characters\)
  533. sed "s/^X//" >'man/UUSer' <<'END_OF_FILE'
  534. X
  535. X
  536. XNAME
  537. X    UUser    (AmigaDOS Handler)
  538. X
  539. XSYNOPSIS
  540. X    Mount uuser:
  541. X
  542. X    Open Format:    uuser:devicename/unit/options
  543. X    Example:    uuser:serial.device/0/R1000
  544. X
  545. XDESCRIPTION
  546. X    Options:    Rn    Set read timeout when no data available (millisecs)
  547. X            C0    Ignore carrier detect
  548. X
  549. X    The UUSER: handler allows arbitrary programs to talk to any
  550. X    serial.device and unit uses Read() and Write() calls.
  551. X
  552. X    Consequently, stdio may be used as well.
  553. X
  554. X    UUSER: IS NORMALLY SETUP BY GETTY WHEN IT RUNS A PROGRAM.  See
  555. X    GETTY.MAN for more info.  Essentially, if a '*' appears before
  556. X    the command-to-run in the passwd file Getty will setup UUSER:
  557. X    on the stdin and stdout of the command it runs after a valid
  558. X    login sequence.
  559. X
  560. XDIFFERENCES FROM NORMAL HANDLERS:
  561. X
  562. X    To avoid a gets() or getc() or read() or Read() (or whatever
  563. X    call you use to read data from stdin), UUSER: times out after
  564. X    1 second if no characters have been received.
  565. X
  566. X    If you are using stdio, you get an EOF when this occurs.  You
  567. X    can clear the EOF state by calling clrerr(stdin).
  568. X
  569. X    UUSER: will return immediately when at least one character is
  570. X    ready.    Thus, if you do:
  571. X
  572. X        n = read(0, Buf, 256)
  573. X
  574. X    n will return:
  575. X
  576. X        -1    =   Lost Carrier
  577. X        0    =   Timeout (loop retry?)
  578. X     1-256    =   Anywhere from 1 to 256 bytes have been recevied
  579. X
  580. X    UUSER: checks carrier and if it detects carrier is lost, will
  581. X    return an error for both read and write calls.
  582. X
  583. X    If using stdio for writing, be sure to call fflush(stdout) when
  584. X    you want to flush stdio's buffer to the serial port.
  585. X
  586. END_OF_FILE
  587. if test 1492 -ne `wc -c <'man/UUSer'`; then
  588.     echo shar: \"'man/UUSer'\" unpacked with wrong size!
  589. fi
  590. # end of 'man/UUSer'
  591. fi
  592. if test -f 'man/UUdecode' -a "${1}" != "-c" ; then 
  593.   echo shar: Will not clobber existing file \"'man/UUdecode'\"
  594. else
  595. echo shar: Extracting \"'man/UUdecode'\" \(1736 characters\)
  596. sed "s/^X//" >'man/UUdecode' <<'END_OF_FILE'
  597. X
  598. XNAME
  599. X     uuencode, uudecode - encode/decode a binary file for
  600. X     transmission via mail
  601. X
  602. XSYNTAX
  603. X     uuencode <infilename >outfilename filename
  604. X     uudecode filename.uu
  605. X
  606. XDESCRIPTION
  607. X     The uuencode and uudecode commands are used to send a binary
  608. X     file via uucp (or other) mail.
  609. X
  610. X     The uuencode command takes the named source file (default
  611. X     standard input) and produces an encoded version on the stan-
  612. X     dard output.  The encoding uses only printing ASCII charac-
  613. X     ters, and includes the mode of the file and the remotedest
  614. X     for recreation on the remote system.
  615. X
  616. X     The uudecode command reads an encoded file, strips off any
  617. X     leading and trailing lines added by mailers, and recreates
  618. X     the original file with the specified mode and name.
  619. X
  620. X     The intent is that all mail to the user ``decode'' should be
  621. X     filtered through the uudecode program.  This way the file is
  622. X     created automatically without human intervention.  This is
  623. X     possible on the uucp network by either using sendmail or by
  624. X     making rmail be a link to Mail instead of mail. In each
  625. X     case, an alias must be created in a master file to get the
  626. X     automatic invocation of uudecode.
  627. X
  628. X     If these facilities are not available, the file can be sent
  629. X     to a user on the remote machine who can uudecode it manu-
  630. X     ally.
  631. X
  632. X     The encode file has an ordinary text form and can be edited
  633. X     by any text editor to change the mode or remote name.
  634. X
  635. XRESTRICTIONS
  636. X     The file is expanded by 35% (3 bytes become 4 plus control
  637. X     information) causing it to take longer to transmit.
  638. X
  639. X     The user on the remote system who is invoking uudecode
  640. X     (often uucp) must have write permission on the specified
  641. X     file.
  642. X
  643. END_OF_FILE
  644. if test 1736 -ne `wc -c <'man/UUdecode'`; then
  645.     echo shar: \"'man/UUdecode'\" unpacked with wrong size!
  646. fi
  647. # end of 'man/UUdecode'
  648. fi
  649. if test -f 'man/UUencode' -a "${1}" != "-c" ; then 
  650.   echo shar: Will not clobber existing file \"'man/UUencode'\"
  651. else
  652. echo shar: Extracting \"'man/UUencode'\" \(1736 characters\)
  653. sed "s/^X//" >'man/UUencode' <<'END_OF_FILE'
  654. X
  655. XNAME
  656. X     uuencode, uudecode - encode/decode a binary file for
  657. X     transmission via mail
  658. X
  659. XSYNTAX
  660. X     uuencode <infilename >outfilename filename
  661. X     uudecode filename.uu
  662. X
  663. XDESCRIPTION
  664. X     The uuencode and uudecode commands are used to send a binary
  665. X     file via uucp (or other) mail.
  666. X
  667. X     The uuencode command takes the named source file (default
  668. X     standard input) and produces an encoded version on the stan-
  669. X     dard output.  The encoding uses only printing ASCII charac-
  670. X     ters, and includes the mode of the file and the remotedest
  671. X     for recreation on the remote system.
  672. X
  673. X     The uudecode command reads an encoded file, strips off any
  674. X     leading and trailing lines added by mailers, and recreates
  675. X     the original file with the specified mode and name.
  676. X
  677. X     The intent is that all mail to the user ``decode'' should be
  678. X     filtered through the uudecode program.  This way the file is
  679. X     created automatically without human intervention.  This is
  680. X     possible on the uucp network by either using sendmail or by
  681. X     making rmail be a link to Mail instead of mail. In each
  682. X     case, an alias must be created in a master file to get the
  683. X     automatic invocation of uudecode.
  684. X
  685. X     If these facilities are not available, the file can be sent
  686. X     to a user on the remote machine who can uudecode it manu-
  687. X     ally.
  688. X
  689. X     The encode file has an ordinary text form and can be edited
  690. X     by any text editor to change the mode or remote name.
  691. X
  692. XRESTRICTIONS
  693. X     The file is expanded by 35% (3 bytes become 4 plus control
  694. X     information) causing it to take longer to transmit.
  695. X
  696. X     The user on the remote system who is invoking uudecode
  697. X     (often uucp) must have write permission on the specified
  698. X     file.
  699. X
  700. END_OF_FILE
  701. if test 1736 -ne `wc -c <'man/UUencode'`; then
  702.     echo shar: \"'man/UUencode'\" unpacked with wrong size!
  703. fi
  704. # end of 'man/UUencode'
  705. fi
  706. if test -f 'man/man' -a "${1}" != "-c" ; then 
  707.   echo shar: Will not clobber existing file \"'man/man'\"
  708. else
  709. echo shar: Extracting \"'man/man'\" \(1168 characters\)
  710. sed "s/^X//" >'man/man' <<'END_OF_FILE'
  711. X
  712. XNAME
  713. X
  714. X    man - look up documentation on a command
  715. X
  716. XSYNOPSIS
  717. X
  718. X    man command_1 command_2 ... command_N
  719. X
  720. XDESCRIPTION
  721. X
  722. X    "Man" looks in the volume or directory "MAN:" for information
  723. X    about the given commands, and then displays it on the screen.
  724. X
  725. X    Here is exactly how "Man" works.  If you type "Man myCommand",
  726. X    "Man" looks in the directory MAN: for a file called "myCommand".
  727. X    If it finds the file, it displays it on the screen using the
  728. X    file viewing program "more".  ("More" is on the Commodore-Amiga
  729. X    V1.2 Extras disk.)    If no such file is found, you are told.
  730. X
  731. X    So... for any program that you have, put its documentation file
  732. X    in MAN:.  Name the documentation file the same as the program
  733. X    itself.  Instead of searching for that documentation next time,
  734. X    all you have to do is type "Man command-name".
  735. X
  736. X
  737. XFILES
  738. X
  739. X    UULIB:Config  , RFilter or Filter entry sets command Man uses
  740. X            to display a manual page.
  741. X
  742. X    MAN:    Manual directory.
  743. X
  744. X    More    File viewing program, must be in your search path and
  745. X        named "MORE" but does not have to be CBM's more program.
  746. X
  747. X    Assign  For "Assign MAN: some-directory-of-your-choice".
  748. X
  749. END_OF_FILE
  750. if test 1168 -ne `wc -c <'man/man'`; then
  751.     echo shar: \"'man/man'\" unpacked with wrong size!
  752. fi
  753. # end of 'man/man'
  754. fi
  755. if test -f 's/.edrc' -a "${1}" != "-c" ; then 
  756.   echo shar: Will not clobber existing file \"'s/.edrc'\"
  757. else
  758. echo shar: Extracting \"'s/.edrc'\" \(1379 characters\)
  759. sed "s/^X//" >'s/.edrc' <<'END_OF_FILE'
  760. X
  761. Xignorecase on
  762. Xsavetabs on
  763. Xmap c-tab   (ping 0 while c=32 right repeat tr (( ) left) pong 0 down)
  764. Xmap cs-tab  `del del del del down'
  765. Xmap a-tab   `goto block while cb `c-tab down''
  766. Xmap as-tab  `goto block while cb `cs-tab down''
  767. Xmap s-f9    `saveas ram:\$filename'
  768. Xmap a-/     (escimm (findstr ) escimm (repstr ) repeat -1 nextr)
  769. Xmap c-m     menuon
  770. Xmap c-right (repeat 8 tab)
  771. Xmap c-left  (repeat 8 backtab)
  772. Xmap s-return return
  773. Xmap (a- )   (( ))
  774. X
  775. Xmap c-f1    (scanf %s bottom insfile \$scanf)
  776. Xmap c-f2    (scanf %s newfile \$scanf)
  777. Xmap c-f3    (scanf %s newwindow newfile \$scanf)
  778. Xmap s-f7    (setfont topaz.font 7)
  779. Xmap c-[     (ping 1 iconify ctags)
  780. X
  781. X#   DIFF / old version support.  The following macros automatically
  782. X#   diff the file being saved with the old version and save the diff
  783. X#
  784. X#   s-f3 will retrieve the 'old' version.  Aweesome.
  785. X
  786. Xmap s-f3  (set old (\$filename) execute (undiff >T:dme_temp \$filename tmp:diff/\$(fname).D) newwindow newfile T:dme_temp chfilename \$old unset old)
  787. X
  788. Xmap cs-d  (execute (copy \$filename T:dme_temp) saveold execute (diff >tmp:diff/\$(fname).D T:dme_temp \$filename))
  789. X#map f8    (cs-d escimm (newfile ))
  790. X#map f9    (cs-d )
  791. X#map f10   (cs-d quit)
  792. Xmap s-f8  (saveold escimm (newfile ))
  793. Xmap s-f9  (saveold)
  794. Xmap s-f10 (saveold quit)
  795. X
  796. Xaddpath autodocs:
  797. Xaddpath autoincs:
  798. Xaddpath src:suplib/doc
  799. Xaddpath src:dres/doc
  800. Xaddpath src:commonlib/doc
  801. X
  802. END_OF_FILE
  803. if test 1379 -ne `wc -c <'s/.edrc'`; then
  804.     echo shar: \"'s/.edrc'\" unpacked with wrong size!
  805. fi
  806. # end of 's/.edrc'
  807. fi
  808. if test -f 'src/MUtil/man.c' -a "${1}" != "-c" ; then 
  809.   echo shar: Will not clobber existing file \"'src/MUtil/man.c'\"
  810. else
  811. echo shar: Extracting \"'src/MUtil/man.c'\" \(1032 characters\)
  812. sed "s/^X//" >'src/MUtil/man.c' <<'END_OF_FILE'
  813. X
  814. X/*
  815. X *  MAN.C
  816. X *
  817. X *  MAN <topic>
  818. X *
  819. X *  searches for MAN:topic or MAN:topic.Doc
  820. X */
  821. X
  822. X#include <stdio.h>
  823. X#include <stdlib.h>
  824. X#include <config.h>
  825. X#include "/version.h"
  826. X
  827. XIDENT(".00");
  828. X
  829. Xvoid
  830. Xmain(ac, av)
  831. Xchar *av[];
  832. X{
  833. X    short i;
  834. X    static char Buf[256];
  835. X
  836. X    for (i = 1; i < ac; ++i) {
  837. X    char *topic = av[i];
  838. X
  839. X    if (Man(topic) == 0) {
  840. X        sprintf(Buf, "MAN:%s", topic);
  841. X        if (Man(Buf) == 0) {
  842. X        sprintf(Buf, "MAN:%s.Doc", topic);
  843. X        if (Man(Buf) == 0)
  844. X            printf("Unable to open MAN:%s or MAN:%s.Doc\n", topic, topic);
  845. X        }
  846. X    }
  847. X    }
  848. X}
  849. X
  850. XMan(file)
  851. Xchar *file;
  852. X{
  853. X    FILE *fi = fopen(file, "r");
  854. X    char *filter = FindConfig(RFILTER);
  855. X    short rb = 1;
  856. X    static char Cmd[256];
  857. X
  858. X    if (fi == NULL)
  859. X    return(0);
  860. X    if (filter == NULL) {
  861. X    if ((filter = FindConfig(FILTER)) == NULL) {
  862. X        printf("UULIB:Config, no 'Filter' entry\n");
  863. X        return(0);
  864. X    }
  865. X    rb = 0;
  866. X    }
  867. X    fclose(fi);
  868. X    if (rb)
  869. X    sprintf(Cmd, "Run >nil: <nil: %s %s", filter, file);
  870. X    else
  871. X    sprintf(Cmd, "%s %s", filter, file);
  872. X    Execute(Cmd, NULL, NULL);
  873. X}
  874. X
  875. END_OF_FILE
  876. if test 1032 -ne `wc -c <'src/MUtil/man.c'`; then
  877.     echo shar: \"'src/MUtil/man.c'\" unpacked with wrong size!
  878. fi
  879. # end of 'src/MUtil/man.c'
  880. fi
  881. if test -f 'src/MUtil/trimfile.c' -a "${1}" != "-c" ; then 
  882.   echo shar: Will not clobber existing file \"'src/MUtil/trimfile.c'\"
  883. else
  884. echo shar: Extracting \"'src/MUtil/trimfile.c'\" \(1801 characters\)
  885. sed "s/^X//" >'src/MUtil/trimfile.c' <<'END_OF_FILE'
  886. X
  887. X/*
  888. X *  TRIMFILE file1 file2 .. filen -lines
  889. X *
  890. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  891. X *
  892. X *  Trims the specified files to the specified number of lines.  Each
  893. X *  file is read and the last N lines written back.
  894. X *
  895. X *  Normally used to trim log files based on a crontab entry.  If no
  896. X *  -lines argument is given the file is trimmed to 100 lines.
  897. X *
  898. X *  Each line may be up to 255 characters in length.
  899. X */
  900. X
  901. X#include <stdio.h>
  902. X#include <stdlib.h>
  903. X
  904. X#define LINSIZE 256
  905. X
  906. Xchar    **LineBuf;
  907. Xlong    Lines = 100;
  908. X
  909. Xvoid    MemErr();
  910. Xvoid    TrimFile();
  911. X
  912. Xvoid
  913. Xmain(ac, av)
  914. Xchar *av[];
  915. X{
  916. X    short i;
  917. X    for (i = 1; i < ac; ++i) {
  918. X    if (av[i][0] == '-')
  919. X        Lines = atol(av[i] + 1);
  920. X    }
  921. X    if (Lines < 0) {
  922. X    fprintf(stderr, "Illegal line specification %d\n", Lines);
  923. X    exit(1);
  924. X    }
  925. X
  926. X    /*
  927. X     *    Allocating one more than necessary handles the Lines == 0 case
  928. X     *    as well as supplying a scratch buffer for the last fgets that
  929. X     *    fails.
  930. X     */
  931. X
  932. X    LineBuf = malloc(sizeof(char *) * (Lines + 1));
  933. X    if (LineBuf == NULL)
  934. X    MemErr();
  935. X    for (i = 0; i <= Lines; ++i) {
  936. X    LineBuf[i] = malloc(LINSIZE);
  937. X    if (LineBuf[i] == NULL)
  938. X        MemErr();
  939. X    }
  940. X    for (i = 1; i < ac; ++i) {
  941. X    char *ptr = av[i];
  942. X
  943. X    if (*ptr == '-')
  944. X        continue;
  945. X    TrimFile(ptr);
  946. X    }
  947. X}
  948. X
  949. Xvoid
  950. XMemErr()
  951. X{
  952. X    fprintf(stderr, "Not enough memory!\n");
  953. X    exit(1);
  954. X}
  955. X
  956. Xvoid
  957. XTrimFile(name)
  958. Xchar *name;
  959. X{
  960. X    FILE *fi = fopen(name, "r");
  961. X    long rep;
  962. X    long i;
  963. X
  964. X    if (fi == NULL)
  965. X    return;
  966. X
  967. X    i = 0;
  968. X    rep = 0;
  969. X    while (fgets(LineBuf[i], LINSIZE, fi)) {
  970. X    if (++i > Lines) {
  971. X        i = 0;
  972. X        rep = 1;
  973. X    }
  974. X    }
  975. X    fclose(fi);
  976. X
  977. X    if (rep == 0)
  978. X    return;
  979. X
  980. X    if (fi = fopen(name, "w")) {
  981. X    long j;
  982. X    for (j = Lines; j; --j) {
  983. X        if (++i > Lines)
  984. X        i = 0;
  985. X        fputs(LineBuf[i], fi);
  986. X    }
  987. X    fclose(fi);
  988. X    }
  989. X}
  990. X
  991. END_OF_FILE
  992. if test 1801 -ne `wc -c <'src/MUtil/trimfile.c'`; then
  993.     echo shar: \"'src/MUtil/trimfile.c'\" unpacked with wrong size!
  994. fi
  995. # end of 'src/MUtil/trimfile.c'
  996. fi
  997. if test -f 'src/News060/Anews/mscan.c' -a "${1}" != "-c" ; then 
  998.   echo shar: Will not clobber existing file \"'src/News060/Anews/mscan.c'\"
  999. else
  1000. echo shar: Extracting \"'src/News060/Anews/mscan.c'\" \(1607 characters\)
  1001. sed "s/^X//" >'src/News060/Anews/mscan.c' <<'END_OF_FILE'
  1002. X
  1003. X/*
  1004. X * mscan - Scan directories and return a sorted list of file names,
  1005. X *        one at a time.
  1006. X *
  1007. X *  This code originally taken from sysdep.c:
  1008. X *
  1009. X *  (C) Copyright 1987 by John Gilmore
  1010. X *  Copying and use of this program are controlled by the terms of the Free
  1011. X *  Software Foundation's GNU Emacs General Public License.
  1012. X *
  1013. X * Amiga Changes Copyright 1988 by William Loftus. All rights reserved.
  1014. X *
  1015. X * Rewrite for use with manx (or lattice), and Anews.
  1016. X */
  1017. X
  1018. X#include <stdio.h>
  1019. X#include <stdlib.h>
  1020. X
  1021. X#define MAXFILES    512
  1022. X
  1023. Xstatic char names[MAXFILES*10];
  1024. Xstatic char *pointers[MAXFILES];
  1025. X
  1026. Xint file_pointer;  /* External so that it can be read/written */
  1027. X
  1028. Xstatic valid = 0;
  1029. X
  1030. Xchar *
  1031. Xread_directory(dir)
  1032. Xchar *dir;
  1033. X{
  1034. X    int count, mycmp();
  1035. X    char *scdir();
  1036. X    char path[128];
  1037. X
  1038. X    file_pointer = 0;
  1039. X    if (dir) {
  1040. X    getcwd(path,127);
  1041. X    chdir(dir);
  1042. X    }
  1043. X
  1044. X    count = getfnl("#?", names, sizeof(names), 0);
  1045. X
  1046. X    if (dir) chdir(path);
  1047. X
  1048. X    if (count > 0) {
  1049. X      if (strbpl(pointers, MAXFILES, names) != count) {
  1050. X     printf("Too many files\n");
  1051. X     return (char *)NULL;
  1052. X      }
  1053. X    } else {
  1054. X      return (char *)NULL;
  1055. X    }
  1056. X
  1057. X    qsort((char *)pointers, count, sizeof(char *), mycmp);
  1058. X
  1059. X    valid = 1;    /* We have some files, and more important, some space has
  1060. X           been malloc'd */
  1061. X
  1062. X    return (char *)1;
  1063. X}
  1064. X
  1065. Xchar *
  1066. Xget_next_file()
  1067. X{
  1068. X char *p;
  1069. X
  1070. X  if ( (p=pointers[file_pointer++]) == NULL )
  1071. X    file_pointer=0;
  1072. X  return p;
  1073. X}
  1074. X
  1075. Xfree_directory()
  1076. X{
  1077. X   int i;
  1078. X   if (valid) {
  1079. X    for(i=0;pointers[i] != NULL;i++)
  1080. X        free(pointers[i]);
  1081. X
  1082. X    valid = 0;
  1083. X    }
  1084. X    return(0);
  1085. X}
  1086. X
  1087. Xmycmp(a,b)
  1088. Xchar **a,**b;
  1089. X{
  1090. X    return (atol(*a)-atol(*b));
  1091. X}
  1092. X
  1093. X
  1094. END_OF_FILE
  1095. if test 1607 -ne `wc -c <'src/News060/Anews/mscan.c'`; then
  1096.     echo shar: \"'src/News060/Anews/mscan.c'\" unpacked with wrong size!
  1097. fi
  1098. # end of 'src/News060/Anews/mscan.c'
  1099. fi
  1100. if test -f 'src/compress/uuencode.c' -a "${1}" != "-c" ; then 
  1101.   echo shar: Will not clobber existing file \"'src/compress/uuencode.c'\"
  1102. else
  1103. echo shar: Extracting \"'src/compress/uuencode.c'\" \(2000 characters\)
  1104. sed "s/^X//" >'src/compress/uuencode.c' <<'END_OF_FILE'
  1105. X
  1106. X/*
  1107. X * uuencode [input] output
  1108. X *
  1109. X * Encode a file so it can be mailed to a remote system.
  1110. X */
  1111. X
  1112. X#include <stdio.h>
  1113. X#include "/version.h"
  1114. X
  1115. XIDENT(".00");
  1116. X
  1117. X#ifdef UNIX
  1118. X# include <sys/types.h>
  1119. X# include <sys/stat.h>
  1120. X#endif
  1121. X
  1122. X#ifdef VMS
  1123. X# include <types.h>
  1124. X# include <stat.h>
  1125. X#endif
  1126. X
  1127. X/* ENC is the basic 1 character encoding function to make a char printing */
  1128. X#define ENC(c) (((c) & 077) + ' ')
  1129. X
  1130. Xvoid outdec();
  1131. Xvoid encode();
  1132. X
  1133. Xvoid
  1134. Xmain(argc, argv)
  1135. Xchar **argv;
  1136. X{
  1137. X    FILE *in;
  1138. X#ifdef UNIX | VMS
  1139. X    struct stat sbuf;
  1140. X#endif
  1141. X    int mode;
  1142. X
  1143. X    /* optional 1st argument */
  1144. X    if (argc > 2) {
  1145. X        if ((in = fopen(argv[1], "r")) == NULL) {
  1146. X            perror(argv[1]);
  1147. X            exit(1);
  1148. X        }
  1149. X        argv++; argc--;
  1150. X    } else
  1151. X        in = stdin;
  1152. X
  1153. X    if (argc != 2) {
  1154. X        printf("Usage: uuencode [infile] remotefile\n");
  1155. X        exit(2);
  1156. X    }
  1157. X
  1158. X    /* figure out the input file mode */
  1159. X#ifdef UNIX | VMS
  1160. X    fstat(fileno(in), &sbuf);
  1161. X    mode = sbuf.st_mode & 0777;
  1162. X#endif
  1163. X
  1164. X#ifdef AMIGA
  1165. X    mode = 0777;
  1166. X#endif
  1167. X    printf("begin %o %s\n", mode, argv[1]);
  1168. X
  1169. X    encode(in, stdout);
  1170. X
  1171. X    printf("end\n");
  1172. X    exit(0);
  1173. X}
  1174. X
  1175. X/*
  1176. X * copy from in to out, encoding as you go along.
  1177. X */
  1178. X
  1179. Xvoid
  1180. Xencode(in, out)
  1181. XFILE *in;
  1182. XFILE *out;
  1183. X{
  1184. X    char buf[80];
  1185. X    int i, n;
  1186. X
  1187. X    for (;;) {
  1188. X        /* 1 (up to) 45 character line */
  1189. X        n = fr(in, buf, 45);
  1190. X        putc(ENC(n), out);
  1191. X
  1192. X        for (i=0; i<n; i += 3)
  1193. X            outdec(&buf[i], out);
  1194. X
  1195. X        putc('X', out);
  1196. X        putc('\n', out);
  1197. X
  1198. X        if (n <= 0)
  1199. X            break;
  1200. X    }
  1201. X}
  1202. X
  1203. X/*
  1204. X * output one group of 3 bytes, pointed at by p, on file f.
  1205. X */
  1206. Xvoid
  1207. Xoutdec(p, f)
  1208. Xchar *p;
  1209. XFILE *f;
  1210. X{
  1211. X    int c1, c2, c3, c4;
  1212. X
  1213. X    c1 = *p >> 2;
  1214. X    c2 = (*p << 4) & 060 | (p[1] >> 4) & 017;
  1215. X    c3 = (p[1] << 2) & 074 | (p[2] >> 6) & 03;
  1216. X    c4 = p[2] & 077;
  1217. X    putc(ENC(c1), f);
  1218. X    putc(ENC(c2), f);
  1219. X    putc(ENC(c3), f);
  1220. X    putc(ENC(c4), f);
  1221. X}
  1222. X
  1223. X/* fr: like read but stdio */
  1224. Xint
  1225. Xfr(fd, buf, cnt)
  1226. XFILE *fd;
  1227. Xchar *buf;
  1228. Xint cnt;
  1229. X{
  1230. X    int c, i;
  1231. X
  1232. X    for (i=0; i<cnt; i++) {
  1233. X        c = getc(fd);
  1234. X        if (c == EOF)
  1235. X            return(i);
  1236. X        buf[i] = c;
  1237. X    }
  1238. X    return (cnt);
  1239. X}
  1240. X
  1241. X#ifdef AMIGA
  1242. Xperror(err)
  1243. Xchar *err;
  1244. X{
  1245. X    printf("Can not open file \"%s\"\n", err);
  1246. X    return(NULL);
  1247. X}
  1248. X#endif
  1249. END_OF_FILE
  1250. if test 2000 -ne `wc -c <'src/compress/uuencode.c'`; then
  1251.     echo shar: \"'src/compress/uuencode.c'\" unpacked with wrong size!
  1252. fi
  1253. # end of 'src/compress/uuencode.c'
  1254. fi
  1255. if test -f 'src/dmail/DMakefile' -a "${1}" != "-c" ; then 
  1256.   echo shar: Will not clobber existing file \"'src/dmail/DMakefile'\"
  1257. else
  1258. echo shar: Extracting \"'src/dmail/DMakefile'\" \(1616 characters\)
  1259. sed "s/^X//" >'src/dmail/DMakefile' <<'END_OF_FILE'
  1260. X
  1261. X#VERSION 1.11
  1262. X#
  1263. X#   Written by Matthew Dillon
  1264. X#
  1265. X#   (C)Copyright 1986-89 by Matthew Dillon
  1266. X#
  1267. X#   This code is completely original.  I declare this code to be public
  1268. X#   domain.  You may redistribute this code as long as any those
  1269. X#    redistributions contain this and all other files in their entirety.
  1270. X#
  1271. X#    Ports: Anybody may port this code to any machine or OS they wish, of
  1272. X#    course.  If you do make a port, I would be grateful if you mailed
  1273. X#    a letter with: (A) OS you ported it too, and (B) version ported,
  1274. X#    so I may inform people who have mailed me wondering about ports
  1275. X#    who to contact.
  1276. X#
  1277. X#   Send bug reports and other gripes to:
  1278. X#
  1279. X#   dillon@ucbvax.berkeley.edu           ARPA NET
  1280. X#   ..!ihnp4!ucbvax!dillon           USENET
  1281. X#
  1282. X#   INSTRUCTIONS FOR COMPILING:
  1283. X#
  1284. X#   (1) Set DESTDIR & HELP_DIR to some global directory accessable to
  1285. X#    everybody (or whatever).  Also set HELP_CHMOD and PROG_CHMOD
  1286. X#    to the right thing if you don't like the defaults.
  1287. X#
  1288. X#   (2) Do ONE of the following:
  1289. X#    make        -defaults to internal help file
  1290. X#    make external    -external help file (executable is smaller)
  1291. X#
  1292. X#   (3) make install to install the file(s)
  1293. X#
  1294. X
  1295. XOD= ltmp:dmail/
  1296. XEXE= uucp:c/dmail
  1297. XSYMS= uucp:src/lib/all.m
  1298. XCFLAGS= -iuucp:src/include/
  1299. X
  1300. XLIBS=    uucp:src/lib/uucp.lib lib:lc.lib lib:amiga.lib
  1301. X
  1302. XSRCS=    globals.c main.c do_lists.c sub.c execom.c commands.c \
  1303. X    range.c load_mail.c sendmail.c set.c help.c cond.c compat.c
  1304. X
  1305. XOBJS=    $(SRCS:"*.c":"$(OD)*.o")
  1306. X
  1307. X$(EXE): $(OBJS)
  1308. X    cd $(OD)
  1309. X    list #?.o TO T:DMAILOBJS LFORMAT %s
  1310. X    blink lib:c.o WITH T:DMAILOBJS LIB $(LIBS) TO %(left)
  1311. X    cd
  1312. X
  1313. X$(OBJS) : $(SRCS)
  1314. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  1315. X
  1316. END_OF_FILE
  1317. if test 1616 -ne `wc -c <'src/dmail/DMakefile'`; then
  1318.     echo shar: \"'src/dmail/DMakefile'\" unpacked with wrong size!
  1319. fi
  1320. # end of 'src/dmail/DMakefile'
  1321. fi
  1322. if test -f 'src/dmail/cond.c' -a "${1}" != "-c" ; then 
  1323.   echo shar: Will not clobber existing file \"'src/dmail/cond.c'\"
  1324. else
  1325. echo shar: Extracting \"'src/dmail/cond.c'\" \(1358 characters\)
  1326. sed "s/^X//" >'src/dmail/cond.c' <<'END_OF_FILE'
  1327. X
  1328. X/*
  1329. X * COND.C
  1330. X *
  1331. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1332. X *
  1333. X * Conditional routines.
  1334. X *
  1335. X * if [!]variable
  1336. X * else
  1337. X * endif
  1338. X *
  1339. X */
  1340. X
  1341. X#include <stdio.h>
  1342. X#include "dmail.h"
  1343. X
  1344. X#define MAXIF    16
  1345. X
  1346. Xstatic int Disable_if, Disable_case;
  1347. X
  1348. Xstatic int If_level;
  1349. Xstatic char If_state[MAXIF];
  1350. X
  1351. Xdo_if()
  1352. X{
  1353. X    char *str = av[1];
  1354. X    int result = 0;
  1355. X
  1356. X    if (ac != 2) {
  1357. X    puts ("if: bad args");
  1358. X    return(-1);
  1359. X    }
  1360. X    if (Disable_if) {
  1361. X    ++Disable_if;
  1362. X    return (1);
  1363. X    }
  1364. X    if (If_level == MAXIF) {
  1365. X    puts ("Too many level's of IF's");
  1366. X    return (-1);
  1367. X    }
  1368. X    if (*str == '!') {
  1369. X    ++str;
  1370. X    result = 1;
  1371. X    }
  1372. X    if (get_var(LEVEL_SET, str))
  1373. X    result = 1 - result;
  1374. X    if (!result)
  1375. X    ++Disable_if;
  1376. X    If_state[If_level++] = result;
  1377. X    XDisable = Disable_if + Disable_case;
  1378. X    return (1);
  1379. X}
  1380. X
  1381. Xdo_else()
  1382. X{
  1383. X    if (Disable_if > 1)
  1384. X    return (1);
  1385. X    if (If_level < 1) {
  1386. X    puts ("else without if");
  1387. X    return (-1);
  1388. X    }
  1389. X    Disable_if = !(If_state[If_level - 1] = 1 - If_state[If_level - 1]);
  1390. X    XDisable = Disable_if + Disable_case;
  1391. X    return (1);
  1392. X}
  1393. X
  1394. Xdo_endif()
  1395. X{
  1396. X    if (Disable_if == 1) {
  1397. X    --If_level;
  1398. X    Disable_if = 0;
  1399. X    } else
  1400. X    if (Disable_if > 1) {
  1401. X    --Disable_if;
  1402. X    } else {
  1403. X    if (If_level == 0) {
  1404. X        puts ("endif without if");
  1405. X        return (-1);
  1406. X    }
  1407. X    --If_level;
  1408. X    Disable_if = 0;
  1409. X    }
  1410. X    XDisable = Disable_if + Disable_case;
  1411. X    return (1);
  1412. X}
  1413. X
  1414. X
  1415. END_OF_FILE
  1416. if test 1358 -ne `wc -c <'src/dmail/cond.c'`; then
  1417.     echo shar: \"'src/dmail/cond.c'\" unpacked with wrong size!
  1418. fi
  1419. # end of 'src/dmail/cond.c'
  1420. fi
  1421. if test -f 'src/dmail/globals.c' -a "${1}" != "-c" ; then 
  1422.   echo shar: Will not clobber existing file \"'src/dmail/globals.c'\"
  1423. else
  1424. echo shar: Extracting \"'src/dmail/globals.c'\" \(1850 characters\)
  1425. sed "s/^X//" >'src/dmail/globals.c' <<'END_OF_FILE'
  1426. X
  1427. X/*
  1428. X * GLOBALS.C
  1429. X *
  1430. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1431. X *
  1432. X *  Declarations for most global variables.
  1433. X *
  1434. X */
  1435. X
  1436. X#include <stdio.h>
  1437. X#include "dmail.h"
  1438. X
  1439. XFILE *m_fi;                /* open file ptr to spool file  */
  1440. Xchar *mail_file;            /* name of from (spool) file    */
  1441. Xchar *output_file;            /* name of out file (i.e. mbox) */
  1442. Xchar *user_name;            /* user name from password entry*/
  1443. Xchar *home_dir;             /* home directory of user        */
  1444. Xchar *visual;                /* visual editor path        */
  1445. Xchar Buf[MAXFIELDSIZE];         /* Scratch Buffer            */
  1446. Xchar Puf[MAXFIELDSIZE];         /* Another Scratch Buffer        */
  1447. Xjmp_buf env[LONGSTACK];         /* Holds longjump (break) stack */
  1448. Xint  Did_cd;                /* Set if user does a CD        */
  1449. Xint  XDebug;                /* Debug mode            */
  1450. Xint  Longstack, Breakstack;        /* longjump/break level stack   */
  1451. Xint  Entries, Current;            /* #Entries and Current entry   */
  1452. Xint  XDisable;                /* Disable non-cond comm exec.  */
  1453. Xint  ac;                /* internal argc, from/to stat  */
  1454. Xint  No_load_mail;            /* disable loading of mail        */
  1455. Xint  lmessage_overide;            /* Overide initial 'X items ... */
  1456. Xint  Silence;                /* -s command option status     */
  1457. Xstruct ENTRY *Entry;            /* Base of Entry list        */
  1458. Xchar *av[128];                /* internal argv[]            */
  1459. Xchar *Nulav[3] = { "", "", NULL };
  1460. X
  1461. Xint width[MAXLIST]  = { 18, 38, 10 };    /* Default setlist params    */
  1462. Xint header[MAXLIST] = {  0,  2,  1 };
  1463. Xint Listsize = 3;
  1464. X
  1465. X/* The following are globals variables definable from the 'set' command */
  1466. X
  1467. Xchar  *S_sendmail;            /* sendmail program path        */
  1468. Xint   S_page;                /* Paging status            */
  1469. Xint   S_novibreak;            /* vi-break status            */
  1470. Xint   S_verbose;            /* sendmail verbose status        */
  1471. Xint   S_ask;                /* Ask what to do after mail ed */
  1472. Xint   S_archive;            /* Archive sent mail        */
  1473. X
  1474. END_OF_FILE
  1475. if test 1850 -ne `wc -c <'src/dmail/globals.c'`; then
  1476.     echo shar: \"'src/dmail/globals.c'\" unpacked with wrong size!
  1477. fi
  1478. # end of 'src/dmail/globals.c'
  1479. fi
  1480. if test -f 'src/getty/passwd.c' -a "${1}" != "-c" ; then 
  1481.   echo shar: Will not clobber existing file \"'src/getty/passwd.c'\"
  1482. else
  1483. echo shar: Extracting \"'src/getty/passwd.c'\" \(1689 characters\)
  1484. sed "s/^X//" >'src/getty/passwd.c' <<'END_OF_FILE'
  1485. X
  1486. X/*
  1487. X *  PASSWD.C
  1488. X *
  1489. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1490. X *
  1491. X */
  1492. X
  1493. X#include <exec/types.h>
  1494. X#include <libraries/dosextens.h>
  1495. X#include <stdio.h>
  1496. X#include <stdlib.h>
  1497. X#include <pwd.h>
  1498. X#include <proto/all.h>
  1499. X
  1500. X#include "log.h"
  1501. X
  1502. X#define BTOCP(bp,type)  ((type)((long)bp << 2))
  1503. X
  1504. Xextern long NullFH;
  1505. Xextern char LoginBuf[];
  1506. Xextern char PasswdBuf[];
  1507. Xextern char *DeviceName;
  1508. Xextern long DeviceUnit;
  1509. X
  1510. Xstatic struct passwd *Pas;
  1511. X
  1512. XCheckLoginAndPassword()
  1513. X{
  1514. X    Pas = getpwnam(LoginBuf);
  1515. X
  1516. X    if (Pas == NULL)
  1517. X    return(0);
  1518. X    if (strcmp(Pas->pw_passwd, "*") == 0)
  1519. X    return(1);
  1520. X    if (strcmp(PasswdBuf, Pas->pw_passwd) == 0)
  1521. X    return(1);
  1522. X    return(0);
  1523. X}
  1524. X
  1525. Xvoid
  1526. XRunPasswdEntry()
  1527. X{
  1528. X    static char buf[256];
  1529. X    static char redir[128];
  1530. X    char *arg0 = Pas->pw_shell_arg0;
  1531. X    struct Process *proc = (struct Process *)FindTask(NULL);
  1532. X    APTR oldConsoleTask = proc->pr_ConsoleTask;
  1533. X    BPTR oldDir;
  1534. X    BPTR DirLock;
  1535. X
  1536. X    strcpy(redir, " ");
  1537. X
  1538. X    if (*arg0 == '*') {
  1539. X    ++arg0;
  1540. X    sprintf(redir, " >UUSER:%s/%d/R1000G1 <UUSER:%s/%d/R1000G1 ", DeviceName, DeviceUnit, DeviceName, DeviceUnit);
  1541. X    } else {
  1542. X    if (LogToStdout == 0)
  1543. X        strcpy(redir, " >null: <null: ");
  1544. X    }
  1545. X    if (LogToStdout == 0)
  1546. X    proc->pr_ConsoleTask = (APTR)BTOCP(NullFH, struct FileHandle *)->fh_Port;
  1547. X
  1548. X    sprintf(buf, "%s%s%s -Getty -DEVICE %s -UNIT %d", arg0, redir, Pas->pw_shell_argn, DeviceName, DeviceUnit);
  1549. X
  1550. X    DirLock = (BPTR)Lock(Pas->pw_dir, SHARED_LOCK);
  1551. X    if (DirLock)
  1552. X    oldDir = (BPTR)CurrentDir(DirLock);
  1553. X
  1554. X    ulog(1, "Execute %s\n", buf);
  1555. X
  1556. X    Execute(buf, NullFH, NullFH);
  1557. X
  1558. X    proc->pr_ConsoleTask = oldConsoleTask;
  1559. X
  1560. X    if (DirLock)
  1561. X    UnLock(CurrentDir(oldDir));
  1562. X
  1563. X    ulog(1, "ran\n");
  1564. X}
  1565. X
  1566. END_OF_FILE
  1567. if test 1689 -ne `wc -c <'src/getty/passwd.c'`; then
  1568.     echo shar: \"'src/getty/passwd.c'\" unpacked with wrong size!
  1569. fi
  1570. # end of 'src/getty/passwd.c'
  1571. fi
  1572. if test -f 'src/include/config.h' -a "${1}" != "-c" ; then 
  1573.   echo shar: Will not clobber existing file \"'src/include/config.h'\"
  1574. else
  1575. echo shar: Extracting \"'src/include/config.h'\" \(1625 characters\)
  1576. sed "s/^X//" >'src/include/config.h' <<'END_OF_FILE'
  1577. X
  1578. X/*
  1579. X *  CONFIG.H
  1580. X *
  1581. X *  OBSOLETE, DO NOT USE
  1582. X */
  1583. X
  1584. Xchar *FindConfig(char *);
  1585. Xchar *GetConfig(char *, char *);
  1586. X
  1587. X#define USERNAME    "UserName"
  1588. X#define NODENAME    "NodeName"
  1589. X#define REALNAME    "RealName"
  1590. X#define DEBUGNAME    "Debug"
  1591. X#define NEWSFEED    "NewsFeed"
  1592. X#define ORGANIZATION    "Organization"
  1593. X#define FILTER        "Filter"        /*  can be run in the foregnd    */
  1594. X#define RFILTER     "RFilter"       /*  can be run in the background */
  1595. X#define EDITOR        "MailEditor"
  1596. X#define HOME        "Home"
  1597. X
  1598. X/*
  1599. X *
  1600. X * This idea (and base) for this code was written by Fred Cassirer 10/9/88
  1601. X * as a Config file for News programs, to whom I say Thanx!
  1602. X *
  1603. X * It has since been expanded to include all the directory paths and some
  1604. X * command/filenames. This is to eliminate the forced use of hardcoding in
  1605. X * the executables.
  1606. X *
  1607. X * Simply change any of these you may need to, and recompile as needed.
  1608. X *
  1609. X * Sneakers 11/21/88
  1610. X *
  1611. X */
  1612. X
  1613. X#define MAXGROUPS 1024    /* Maximum # of subscribed newsgroups */
  1614. X#define MAXFILES  300    /* Max # of files in any news or spool directory */
  1615. X
  1616. X#define NEWSGROUPS "uulib:NewsGroups/" /* List of subscribed newsgroups */
  1617. X#define SAVEDIR    "uunews:Save/"      /* Place to save interesting article */
  1618. X#define NEWSDIR    "uunews:"           /* Directory to deposit the news */
  1619. X
  1620. X#define ERRORFILE  "uuspool:error.log"    /* File to hold any errors      */
  1621. X
  1622. X#ifdef NOTDEF
  1623. X
  1624. X#define CRONTAB    "uulib:CronTab"        /* Actual crontab file location */
  1625. X#define CRONERR    "uuspool:CronErro"     /* Location of cron error file  */
  1626. X
  1627. X#define CONFILE    "uulib:Config"         /* Location of the config file  */
  1628. X
  1629. X#endif
  1630. X
  1631. X/* #include <proto/all.h> */
  1632. X
  1633. END_OF_FILE
  1634. if test 1625 -ne `wc -c <'src/include/config.h'`; then
  1635.     echo shar: \"'src/include/config.h'\" unpacked with wrong size!
  1636. fi
  1637. # end of 'src/include/config.h'
  1638. fi
  1639. if test -f 'src/lib/config.c' -a "${1}" != "-c" ; then 
  1640.   echo shar: Will not clobber existing file \"'src/lib/config.c'\"
  1641. else
  1642. echo shar: Extracting \"'src/lib/config.c'\" \(1505 characters\)
  1643. sed "s/^X//" >'src/lib/config.c' <<'END_OF_FILE'
  1644. X
  1645. X/*
  1646. X *  CONFIG.C
  1647. X *
  1648. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1649. X *
  1650. X *  Extract fields from UULIB:Config
  1651. X */
  1652. X
  1653. X#include <stdio.h>
  1654. X#include <stdlib.h>
  1655. X#include <config.h>
  1656. X
  1657. X#define CTLZ    ('z'&0x1F)
  1658. X
  1659. Xstatic char *ConfBuf = NULL;
  1660. X
  1661. Xchar *
  1662. XFindConfig(field)
  1663. Xchar *field;
  1664. X{
  1665. X    char *str;
  1666. X    short flen = strlen(field);
  1667. X
  1668. X    if (ConfBuf == NULL) {
  1669. X    FILE *fi = fopen("UULIB:Config", "r");
  1670. X    if (fi) {
  1671. X        long buflen;
  1672. X        fseek(fi, 0L, 2);
  1673. X        buflen = ftell(fi);
  1674. X        fseek(fi, 0L, 0);
  1675. X        if (buflen > 0 && (ConfBuf = malloc(buflen + 1))) {
  1676. X        fread(ConfBuf, buflen, 1, fi);
  1677. X        ConfBuf[buflen] = CTLZ;     /*    can't use \0 */
  1678. X        for (str = ConfBuf; *str; ++str) {
  1679. X            char *bup;
  1680. X            if (*str == '\n') {     /*  make separate strs */
  1681. X            *str = 0;
  1682. X                        /*    remove white space at end */
  1683. X            for (bup = str - 1; bup >= ConfBuf && (*bup == ' ' || *bup == 9); --bup)
  1684. X                *bup = 0;
  1685. X            }
  1686. X        }
  1687. X        } else {
  1688. X        ConfBuf = NULL;
  1689. X        }
  1690. X    }
  1691. X    }
  1692. X    if (ConfBuf == NULL)
  1693. X    return(NULL);
  1694. X    /*
  1695. X     *    Search ConfBuf for Field<space/tab>
  1696. X     */
  1697. X
  1698. X    for (str = ConfBuf; *str != CTLZ; str += strlen(str) + 1) {
  1699. X    if (*str == 0)
  1700. X        continue;
  1701. X    if (strncmp(str, field, flen) == 0 && (str[flen] == ' ' || str[flen] == '\t')) {
  1702. X        str += flen;
  1703. X        while (*str == ' ' || *str == 9)
  1704. X        ++str;
  1705. X        return(str);
  1706. X    }
  1707. X    }
  1708. X    return(NULL);
  1709. X}
  1710. X
  1711. Xchar *
  1712. XGetConfig(field, def)
  1713. Xchar *field;
  1714. Xchar *def;
  1715. X{
  1716. X    char *result = FindConfig(field);
  1717. X
  1718. X    if (result == NULL)
  1719. X    result = def;
  1720. X    return(result);
  1721. X}
  1722. X
  1723. END_OF_FILE
  1724. if test 1505 -ne `wc -c <'src/lib/config.c'`; then
  1725.     echo shar: \"'src/lib/config.c'\" unpacked with wrong size!
  1726. fi
  1727. # end of 'src/lib/config.c'
  1728. fi
  1729. if test -f 'src/lib/getpwnam.c' -a "${1}" != "-c" ; then 
  1730.   echo shar: Will not clobber existing file \"'src/lib/getpwnam.c'\"
  1731. else
  1732. echo shar: Extracting \"'src/lib/getpwnam.c'\" \(1815 characters\)
  1733. sed "s/^X//" >'src/lib/getpwnam.c' <<'END_OF_FILE'
  1734. X
  1735. X/*
  1736. X *  GETPWNAM.C
  1737. X *
  1738. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1739. X *
  1740. X *  (UUCP source support)
  1741. X */
  1742. X
  1743. X#include <stdio.h>
  1744. X#include <stdlib.h>
  1745. X#include <pwd.h>
  1746. X
  1747. Xstatic char *Breakout();
  1748. X
  1749. Xchar *PasswdFile = "UULIB:passwd";
  1750. X
  1751. Xstruct passwd *
  1752. Xgetpwnam(name)
  1753. Xchar *name;
  1754. X{
  1755. X    FILE *fi = fopen(PasswdFile, "r");
  1756. X    char *buf = malloc(256);
  1757. X    static char User[32];
  1758. X    static char Passwd[32];
  1759. X    static char Dir[128];
  1760. X    static char Shell[256];
  1761. X    static struct passwd Pas = { User, Passwd, 0, 0, 0, "", "", Dir, Shell };
  1762. X
  1763. X    if (fi == NULL)
  1764. X    return(NULL);
  1765. X
  1766. X    while (fgets(buf, 256, fi)) {
  1767. X    char *ptr = buf;
  1768. X    char *arg;
  1769. X
  1770. X    arg = Breakout(&ptr);
  1771. X    if (strcmp(name, arg) != 0)
  1772. X        continue;
  1773. X    strcpy(Pas.pw_name, arg);
  1774. X    strcpy(Pas.pw_passwd, Breakout(&ptr));
  1775. X    Pas.pw_uid = atoi(Breakout(&ptr));
  1776. X    Pas.pw_gid = atoi(Breakout(&ptr));
  1777. X    Breakout(&ptr);     /*  finger info */
  1778. X    strcpy(Pas.pw_dir, Breakout(&ptr));
  1779. X    strcpy(Pas.pw_shell, Breakout(&ptr));
  1780. X
  1781. X    {
  1782. X        short i = strlen(Pas.pw_dir) - 1;
  1783. X        if (i >= 0 && Pas.pw_dir[i] != ':' && Pas.pw_dir[i] != '/') {
  1784. X        Pas.pw_dir[i++] = '/';
  1785. X        Pas.pw_dir[i] = 0;
  1786. X        }
  1787. X    }
  1788. X
  1789. X    {
  1790. X        char *str;
  1791. X
  1792. X        Pas.pw_shell_arg0 = Pas.pw_shell;
  1793. X        for (str = Pas.pw_shell; *str && *str != ' ' && *str != 9; ++str);
  1794. X        if (*str) {
  1795. X        *str = 0;
  1796. X        ++str;
  1797. X        while (*str == ' ' || *str == 9)
  1798. X            ++str;
  1799. X        Pas.pw_shell_argn = str;
  1800. X        } else {
  1801. X        Pas.pw_shell_argn = str;
  1802. X        }
  1803. X    }
  1804. X
  1805. X
  1806. X    fclose(fi);
  1807. X    return(&Pas);
  1808. X    }
  1809. X    fclose(fi);
  1810. X    return(NULL);
  1811. X}
  1812. X
  1813. Xstatic
  1814. Xchar *
  1815. XBreakout(pptr)
  1816. Xchar **pptr;
  1817. X{
  1818. X    char *base;
  1819. X    char *ptr;
  1820. X
  1821. X    base = *pptr;
  1822. X    if (base == NULL)
  1823. X    return("");
  1824. X    for (ptr = base; *ptr && *ptr != '\n' && *ptr != ','; ++ptr);
  1825. X    if (*ptr == ',') {
  1826. X    *pptr = ptr + 1;
  1827. X    *ptr = 0;
  1828. X    } else {
  1829. X    *pptr = NULL;
  1830. X    *ptr = 0;
  1831. X    }
  1832. X    return(base);
  1833. X}
  1834. X
  1835. END_OF_FILE
  1836. if test 1815 -ne `wc -c <'src/lib/getpwnam.c'`; then
  1837.     echo shar: \"'src/lib/getpwnam.c'\" unpacked with wrong size!
  1838. fi
  1839. # end of 'src/lib/getpwnam.c'
  1840. fi
  1841. if test -f 'src/lib/log.c' -a "${1}" != "-c" ; then 
  1842.   echo shar: Will not clobber existing file \"'src/lib/log.c'\"
  1843. else
  1844. echo shar: Extracting \"'src/lib/log.c'\" \(1273 characters\)
  1845. sed "s/^X//" >'src/lib/log.c' <<'END_OF_FILE'
  1846. X
  1847. X/*
  1848. X *  LOG.C
  1849. X *
  1850. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1851. X *
  1852. X *  ulog(level, ctl, args...)
  1853. X */
  1854. X
  1855. X#include <proto/all.h>
  1856. X#include <stdio.h>
  1857. X#include <stdlib.h>
  1858. X#include <fcntl.h>
  1859. X#include <time.h>
  1860. X
  1861. X#include "log.h"
  1862. X
  1863. Xint    LogLevel = -1;
  1864. Xint    LogToStdout = 0;
  1865. Xchar    *LogProgram = "-";
  1866. Xchar    *LogHost = "-";
  1867. Xchar    *LogWho = "-";
  1868. Xchar    *LogFile = "UUSPOOL:LOGFILE";
  1869. Xchar    LogBuf[512];
  1870. X
  1871. Xvoid
  1872. Xulog(level, ctl, arg1, arg2, arg3, arg4, arg5, arg6)
  1873. Xint level;
  1874. Xchar *ctl;
  1875. Xlong arg1, arg2, arg3, arg4, arg5, arg6;
  1876. X{
  1877. X    long clock;
  1878. X    struct tm *ut;
  1879. X    int logfd;
  1880. X    int len;
  1881. X
  1882. X    if (level > LogLevel)
  1883. X    return;
  1884. X
  1885. X    (void)time(&clock);
  1886. X    ut = localtime(&clock);
  1887. X
  1888. X    sprintf(LogBuf, "(%d/%d-%d:%02d:%02d) %s,%s,%s ",
  1889. X    ut->tm_mon+1, ut->tm_mday, ut->tm_hour, ut->tm_min, ut->tm_sec,
  1890. X    LogProgram,
  1891. X    LogHost,
  1892. X    LogWho
  1893. X    );
  1894. X    sprintf(LogBuf + strlen(LogBuf), ctl, arg1, arg2, arg3, arg4, arg5, arg6);
  1895. X
  1896. X    len = strlen(LogBuf);
  1897. X    LogBuf[len++] = '\n';
  1898. X    LogBuf[len] = 0;
  1899. X
  1900. X    DEBUG(0, "%s", LogBuf);
  1901. X
  1902. X    if (LogToStdout) {
  1903. X    write(1, LogBuf, len);
  1904. X    return;
  1905. X    }
  1906. X
  1907. X    logfd = open(LogFile, O_CREAT|O_WRONLY|O_APPEND, 0644);
  1908. X    if (logfd >= 0) {
  1909. X    write(logfd, LogBuf, len);
  1910. X    close(logfd);
  1911. X    } else {
  1912. X    fprintf(stderr, "Can't open %s\n", LogFile);
  1913. X    }
  1914. X}
  1915. X
  1916. END_OF_FILE
  1917. if test 1273 -ne `wc -c <'src/lib/log.c'`; then
  1918.     echo shar: \"'src/lib/log.c'\" unpacked with wrong size!
  1919. fi
  1920. # end of 'src/lib/log.c'
  1921. fi
  1922. if test -f 'src/sendmail/parse.c' -a "${1}" != "-c" ; then 
  1923.   echo shar: Will not clobber existing file \"'src/sendmail/parse.c'\"
  1924. else
  1925. echo shar: Extracting \"'src/sendmail/parse.c'\" \(1232 characters\)
  1926. sed "s/^X//" >'src/sendmail/parse.c' <<'END_OF_FILE'
  1927. X
  1928. X/*
  1929. X *  PARSE.C
  1930. X *
  1931. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1932. X */
  1933. X
  1934. X#include <proto/all.h>
  1935. X#include <stdio.h>
  1936. X#include <stdlib.h>
  1937. X
  1938. X/*
  1939. X *  PARSEADDRESS()
  1940. X *
  1941. X *  Takes an address containing ! @ % : and converts it to a level 3 ! path.
  1942. X *
  1943. X *  [path]@mach     ->  mach[!path]
  1944. X *  [path]%mach     ->  mach[!path]
  1945. X *  patha:pathb     ->  patha!pathb
  1946. X *  patha:pathb:pathc    ->  patha!pathb!pathc
  1947. X */
  1948. X
  1949. XParseAddress(str, buf, len)
  1950. Xchar *str;
  1951. Xchar *buf;
  1952. Xshort len;
  1953. X{
  1954. X    short i;
  1955. X    short j;
  1956. X    char *base = buf;
  1957. X    char *ParseAddress2();
  1958. X
  1959. X    for (i = j = 0; i < len; ++i) {
  1960. X    if (str[i] == ':') {
  1961. X        buf = ParseAddress2(str + j, buf, i - j);
  1962. X        *buf++ = '!';
  1963. X        j = i + 1;
  1964. X    }
  1965. X    }
  1966. X    buf = ParseAddress2(str + j, buf, i - j);
  1967. X    *buf = 0;
  1968. X    for (i = 0; base[i] && base[i] != '!'; ++i);
  1969. X    return((int)i);
  1970. X}
  1971. X
  1972. X/*
  1973. X *  deals with !, @, and %
  1974. X */
  1975. X
  1976. Xchar *
  1977. XParseAddress2(addr, buf, len)
  1978. Xchar *addr;
  1979. Xchar *buf;
  1980. Xshort len;
  1981. X{
  1982. X    short i;
  1983. X
  1984. X    for (i = len - 1; i >= 0; --i) {
  1985. X    if (addr[i] == '@' || addr[i] == '%') {
  1986. X        short j = len - i;
  1987. X        strncpy(buf, addr + i + 1, j - 1);
  1988. X        buf += j - 1;
  1989. X        len -= j;
  1990. X        if (len)
  1991. X        *buf++ = '!';
  1992. X    }
  1993. X    }
  1994. X    strncpy(buf, addr, len);
  1995. X    buf += len;
  1996. X    return(buf);
  1997. X}
  1998. X
  1999. X
  2000. END_OF_FILE
  2001. if test 1232 -ne `wc -c <'src/sendmail/parse.c'`; then
  2002.     echo shar: \"'src/sendmail/parse.c'\" unpacked with wrong size!
  2003. fi
  2004. # end of 'src/sendmail/parse.c'
  2005. fi
  2006. if test -f 'src/uucico/DMakefile' -a "${1}" != "-c" ; then 
  2007.   echo shar: Will not clobber existing file \"'src/uucico/DMakefile'\"
  2008. else
  2009. echo shar: Extracting \"'src/uucico/DMakefile'\" \(974 characters\)
  2010. sed "s/^X//" >'src/uucico/DMakefile' <<'END_OF_FILE'
  2011. X
  2012. X#   DMakefile
  2013. X
  2014. XOD=ltmp:uucp/
  2015. XEXE= uucp:c/
  2016. XSYMS= uucp:src/lib/all.m
  2017. X
  2018. XCFLAGS= -iuucp:src/include/ -cq
  2019. X
  2020. XLOPTS= SC SD LIB uucp:src/lib/uucp.lib lib:lc.lib lib:amiga.lib
  2021. X
  2022. XSRCS=gio.c sysdep.c uucp.c uupoll.c uuxqt.c modem.c uucico.c \
  2023. X    uuhosts.c uuname.c uux.c
  2024. X
  2025. XOBJS=$(SRCS:"*.c":"$(OD)*.o")
  2026. X
  2027. Xall:    $(EXE)uucico $(EXE)uuxqt $(EXE)uupoll \
  2028. X    $(EXE)uux $(EXE)uuname $(EXE)uucp
  2029. X
  2030. X$(EXE)uucico: $(OD)gio.o $(OD)sysdep.o $(OD)modem.o $(OD)uucico.o
  2031. X    blink FROM lib:cres.o %(right) ADDSYM $(LOPTS) TO %(left)
  2032. X
  2033. X$(EXE)uuxqt: $(OD)uuxqt.o
  2034. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  2035. X
  2036. X$(EXE)uupoll: $(OD)uupoll.o
  2037. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  2038. X
  2039. X$(EXE)uux: $(OD)uux.o
  2040. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  2041. X
  2042. X$(EXE)uuname: $(OD)uuname.o
  2043. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  2044. X
  2045. X$(EXE)uucp: $(OD)uucp.o
  2046. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  2047. X
  2048. X$(OBJS) : $(SRCS)
  2049. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  2050. X
  2051. END_OF_FILE
  2052. if test 974 -ne `wc -c <'src/uucico/DMakefile'`; then
  2053.     echo shar: \"'src/uucico/DMakefile'\" unpacked with wrong size!
  2054. fi
  2055. # end of 'src/uucico/DMakefile'
  2056. fi
  2057. if test -f 'src/uucico/sysdep.h' -a "${1}" != "-c" ; then 
  2058.   echo shar: Will not clobber existing file \"'src/uucico/sysdep.h'\"
  2059. else
  2060. echo shar: Extracting \"'src/uucico/sysdep.h'\" \(1876 characters\)
  2061. sed "s/^X//" >'src/uucico/sysdep.h' <<'END_OF_FILE'
  2062. X/* Amiga Port by William Loftus */
  2063. X/* Changes are Copyright 1988 by William Loftus. All rights reserved. */
  2064. X
  2065. X/*
  2066. X * Declarations of gnuucp's system-dependent routines, which
  2067. X * are in the file sysdep.c (a link to one of many system dependent
  2068. X * implementations).
  2069. X */
  2070. X
  2071. Xvoid    munge_filename();
  2072. X
  2073. X/*
  2074. X * Basement level I/O routines
  2075. X *
  2076. X * xwrite() writes a character string to the serial port
  2077. X * xgetc() returns a character from the serial port, or an EOF for timeout.
  2078. X * sigint() restores the state of the serial port on exit.
  2079. X * openline() opens a serial port for an incoming call, waiting for carrier.
  2080. X * openout() opens a serial port for an outgoing call.
  2081. X */
  2082. Xint xwrite();           /* filedesc, buffer, count */
  2083. Xint xgetc();            /* No arg */
  2084. Xint sigint();          /* No arg */
  2085. Xvoid openline();        /* ttyname */
  2086. Xint openout();          /* ttyname */
  2087. Xvoid amiga_setup();     /* No arg */
  2088. X
  2089. X
  2090. X/*
  2091. X * Uucp work queue scan.
  2092. X *
  2093. X * gotsome = work_scan(hostname);
  2094. X *
  2095. X * Result is 1 if there is work, 0 if none.  If result is 1, and work_scan
  2096. X * is called a second time without an intervening work_done, it won't
  2097. X * rescan the directory but simply returns a 1.
  2098. X *
  2099. X * workfile = work_next();
  2100. X *
  2101. X * Result is char * to static filename; or NULL if no more.
  2102. X * We only read the directory once.  If callers want more to rescan it
  2103. X * in case more work is here, they should call work_scan again.
  2104. X *
  2105. X * void work_done();
  2106. X * Clean up a work scan.  No need to call this if work_next returned NULL;
  2107. X * it has cleaned up.
  2108. X */
  2109. Xextern int work_scan();
  2110. Xextern char *work_next();
  2111. Xextern void work_done();
  2112. X
  2113. X/* SERIAL PORT DELARATIONS ALSO TIMER */
  2114. Xextern struct MsgPort *CreatePort();
  2115. Xextern struct IOExtSer *Read_Request;
  2116. Xextern unsigned char rs_in[2];
  2117. Xextern struct IOExtSer *Write_Request;
  2118. Xextern unsigned char rs_out[2];
  2119. Xextern struct timerequest Timer;
  2120. Xextern struct MsgPort *Timer_Port;
  2121. X
  2122. X
  2123. END_OF_FILE
  2124. if test 1876 -ne `wc -c <'src/uucico/sysdep.h'`; then
  2125.     echo shar: \"'src/uucico/sysdep.h'\" unpacked with wrong size!
  2126. fi
  2127. # end of 'src/uucico/sysdep.h'
  2128. fi
  2129. if test -f 'src/uucico/uucp.h' -a "${1}" != "-c" ; then 
  2130.   echo shar: Will not clobber existing file \"'src/uucico/uucp.h'\"
  2131. else
  2132. echo shar: Extracting \"'src/uucico/uucp.h'\" \(1358 characters\)
  2133. sed "s/^X//" >'src/uucico/uucp.h' <<'END_OF_FILE'
  2134. X/*
  2135. X * @(#)uucp.h 1.5 87/08/13 -- uucp.h Copyright 1987 by John Gilmore
  2136. X *
  2137. X * Header file for gnuucp.
  2138. X *
  2139. X * Pieces that look like they might be taken from Unix uucp are
  2140. X * cribbed with the aid of public domain uucp modules (like the F-protocol)
  2141. X * that use that interface.
  2142. X *
  2143. X * Ported to Amiga by William Loftus
  2144. X * Changes Copyright 1988 by William Loftus.  All rights reserved.
  2145. X */
  2146. X
  2147. X#define Ifn    FOO    /* file descriptor of the "phone line" */
  2148. X
  2149. X#define ASSERT(cond, msg, moremsg, huh) /**/
  2150. X
  2151. X/* I may have these flipped from what Unix uses... */
  2152. X/* BUT: my code depends on these values in if (foo()) statements, sigh */
  2153. X#define SUCCESS 0
  2154. X#define FAIL    1
  2155. X
  2156. X#define LOG
  2157. X
  2158. X#define MAXMSGLEN    ((NAMESIZE*4)+SLOP)     /* ?>?? FIXME */
  2159. X#define MAXMSGTIME    60    /* Timeout period for rdmsg */
  2160. X#define MAX_HOST    20    /* Host name length (uucp does 7) */
  2161. X#define MAX_LSYS    500    /* Max length of an L.sys line in chars */
  2162. X#define MAX_CTLLINE    100    /* Max length of a usenet.ctl line */
  2163. X
  2164. X#define CTL_DELIM    " \t\n\r"       /* Delimiters for usenet.ctl */
  2165. X
  2166. Xextern int debug;        /* Debugging level */
  2167. X
  2168. X/*
  2169. X * Timeout for raw characters -- if we don't hear a char within BYTE_TIMEOUT
  2170. X * seconds, we assume the other side has gone away.  Has nothing to do with
  2171. X * retransmission timeouts (if any!).
  2172. X */
  2173. X#define BYTE_TIMEOUT    40
  2174. X#define BYTE_TO     40
  2175. X
  2176. X#define SLOP        10        /* Slop space on arrays */
  2177. X
  2178. END_OF_FILE
  2179. if test 1358 -ne `wc -c <'src/uucico/uucp.h'`; then
  2180.     echo shar: \"'src/uucico/uucp.h'\" unpacked with wrong size!
  2181. fi
  2182. # end of 'src/uucico/uucp.h'
  2183. fi
  2184. if test -f 'src/uucico/version.doc' -a "${1}" != "-c" ; then 
  2185.   echo shar: Will not clobber existing file \"'src/uucico/version.doc'\"
  2186. else
  2187. echo shar: Extracting \"'src/uucico/version.doc'\" \(1459 characters\)
  2188. sed "s/^X//" >'src/uucico/version.doc' <<'END_OF_FILE'
  2189. X
  2190. X<all-Programs>
  2191. X    Dec-89  Matthew Dillon.  Modified to conform with my release.
  2192. X        Specifically, now use common library routines in uucp:src/lib,
  2193. X        file locking routines, logging routines, etc...
  2194. X
  2195. X
  2196. X
  2197. XUUXQT:
  2198. X
  2199. X    .01 First sub release number assigned.
  2200. X
  2201. X
  2202. X    11-Jul-88 by Dan Schein
  2203. X
  2204. X        Added support for unknown command request(s)
  2205. X        Added support for a RMAIL command
  2206. X        Added "New Files Received." message
  2207. X        Added Beta Version number
  2208. X
  2209. XUUCICO:
  2210. X
  2211. X    .06
  2212. X        as of date 25 January 1989
  2213. X
  2214. X    .05
  2215. X        G protocol now windows, window = 2.  Normally
  2216. X        arbitrates for window size, can be defeated (forced to
  2217. X        1) by using -n option.
  2218. X
  2219. X        Accepts filenames ~/path or ~user/path.  ~/path uses
  2220. X        UUPUB: while ~user/path looks up the home directory
  2221. X        in the Getty:Passwd file, defaulting to UUPUB: if
  2222. X        the requested user could not be found.
  2223. X
  2224. X    .04
  2225. X        only deletes queue files in a set if ALL make it
  2226. X        across... before would delete each file individually.
  2227. X
  2228. X        added security feature, does not allow remote end
  2229. X        to send C.#? files to our uuspool:
  2230. X
  2231. X    .02
  2232. X        G protocol rewritten from scratch
  2233. X
  2234. X    .01
  2235. X        Security list (UULIB:Security) allowed directories
  2236. X        for remote requests.
  2237. X
  2238. X        Getty support
  2239. X
  2240. X        File Locking (lib/lockfile.c)
  2241. X
  2242. XUUCP:
  2243. X    .00    First sub release assigned
  2244. X
  2245. XUUNAME:
  2246. X    .00    First sub release assigned
  2247. X
  2248. XUUX:
  2249. X    .01    Uses UULIB: instead of UUCP:LIB
  2250. X
  2251. XUUHOSTS:
  2252. X    .01    Uses UULIB: instead of UUCP:LIB
  2253. X
  2254. XUUPOLL:
  2255. X    .02    Uses UULIB: instead of UUCP:LIB
  2256. X        Uses run >nil: <nil: instead of brun
  2257. X
  2258. END_OF_FILE
  2259. if test 1459 -ne `wc -c <'src/uucico/version.doc'`; then
  2260.     echo shar: \"'src/uucico/version.doc'\" unpacked with wrong size!
  2261. fi
  2262. # end of 'src/uucico/version.doc'
  2263. fi
  2264. if test -f 'src/uuser/misc.c' -a "${1}" != "-c" ; then 
  2265.   echo shar: Will not clobber existing file \"'src/uuser/misc.c'\"
  2266. else
  2267. echo shar: Extracting \"'src/uuser/misc.c'\" \(1880 characters\)
  2268. sed "s/^X//" >'src/uuser/misc.c' <<'END_OF_FILE'
  2269. X
  2270. X/*
  2271. X *  MISC.C  - support routines - Phillip Lindsay (C) Commodore 1986
  2272. X *  You may freely distribute this source and use it for Amiga Development -
  2273. X *  as long as the Copyright notice is left intact.
  2274. X *
  2275. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  2276. X *
  2277. X * 30-SEP-86
  2278. X *
  2279. X *  major modifications by Matthew Dillon for my PIPE: and other devices,
  2280. X *  but basic theorem still Phil's.
  2281. X */
  2282. X
  2283. X#include <exec/types.h>
  2284. X#include <exec/nodes.h>
  2285. X#include <exec/lists.h>
  2286. X#include <exec/ports.h>
  2287. X#include <libraries/dos.h>
  2288. X#include <libraries/dosextens.h>
  2289. X#include <proto/all.h>
  2290. X
  2291. Xtypedef struct Node NODE;
  2292. X
  2293. Xextern void returnpkt();
  2294. X
  2295. Xvoid
  2296. Xreturnpktplain(packet, myproc)
  2297. Xstruct DosPacket *packet;
  2298. Xstruct Process *myproc;
  2299. X{
  2300. X    returnpkt(packet, myproc, packet->dp_Res1, packet->dp_Res2);
  2301. X}
  2302. X
  2303. X
  2304. Xvoid
  2305. Xreturnpkt(packet, myproc, res1, res2)
  2306. Xregister struct DosPacket *packet;
  2307. Xstruct Process *myproc;
  2308. Xlong res1, res2;
  2309. X{
  2310. X    struct Message *mess;
  2311. X    struct MsgPort *replyport;
  2312. X
  2313. X    packet->dp_Res1         = res1;
  2314. X    packet->dp_Res2         = res2;
  2315. X    replyport             = packet->dp_Port;
  2316. X    mess             = packet->dp_Link;
  2317. X    packet->dp_Port         = &myproc->pr_MsgPort;
  2318. X    mess->mn_Node.ln_Name    = (char *)packet;
  2319. X    mess->mn_Node.ln_Succ    = NULL;
  2320. X    mess->mn_Node.ln_Pred    = NULL;
  2321. X    PutMsg(replyport, mess);
  2322. X}
  2323. X
  2324. X
  2325. X/*
  2326. X * taskwait() ... Waits for a message to arrive at your port and
  2327. X *   extracts the packet address which is returned to you.
  2328. X */
  2329. X
  2330. Xstruct DosPacket *
  2331. Xtaskwait(myproc)
  2332. Xstruct Process *myproc;
  2333. X{
  2334. X    struct MsgPort *myport;
  2335. X    struct Message *mymess;
  2336. X
  2337. X    myport = &myproc->pr_MsgPort;
  2338. X    WaitPort(myport);
  2339. X    mymess = (struct Message *)GetMsg(myport);
  2340. X    return((struct DosPacket *)mymess->mn_Node.ln_Name);
  2341. X}
  2342. X
  2343. Xtaskpktrdy(myproc)
  2344. Xstruct Process *myproc;
  2345. X{
  2346. X    if (((NODE *)myproc->pr_MsgPort.mp_MsgList.lh_Head)->ln_Succ == NULL)
  2347. X    return(0);
  2348. X    return(1);
  2349. X}
  2350. X
  2351. END_OF_FILE
  2352. if test 1880 -ne `wc -c <'src/uuser/misc.c'`; then
  2353.     echo shar: \"'src/uuser/misc.c'\" unpacked with wrong size!
  2354. fi
  2355. # end of 'src/uuser/misc.c'
  2356. fi
  2357. if test -f 'src/uuser/uuser.doc' -a "${1}" != "-c" ; then 
  2358.   echo shar: Will not clobber existing file \"'src/uuser/uuser.doc'\"
  2359. else
  2360. echo shar: Extracting \"'src/uuser/uuser.doc'\" \(2039 characters\)
  2361. sed "s/^X//" >'src/uuser/uuser.doc' <<'END_OF_FILE'
  2362. X
  2363. X                UUSER.DOC
  2364. X
  2365. X                UUSER V1.00 Beta
  2366. X
  2367. X    UUSER: (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  2368. X
  2369. X
  2370. X    Currently UUSER: works only with single sessions started
  2371. X    by Getty (this has to do with how UUSER: deals with carrier
  2372. X    detect).  THIS WILL BE FIXED.
  2373. X
  2374. X    Openning UUSER:
  2375. X
  2376. X    fopen("UUSER:devicename/unit/options", ...);
  2377. X
  2378. X    Example:
  2379. X            (suggested)
  2380. X
  2381. X    int  fd = open("UUSER:serial.device/0/R1000", O_RDWR | O_CREAT | O_TRUNC);
  2382. X
  2383. X            (also can do this -- see below for problems using
  2384. X             stdio to read)
  2385. X
  2386. X    FILE *rfi = fopen("UUSER:serial.device/0/R1000", "r");
  2387. X    FILE *wfi = fopen("UUSER:serial.device/0/R1000", "w");
  2388. X
  2389. X
  2390. X    Features:
  2391. X
  2392. X    * 1K asynchronous write buffer for each file handle.  I.E.
  2393. X      your write() will return when 1K or less remains to be
  2394. X      written (UUSER: has a 1K buffer for spooling these per
  2395. X      file handle)
  2396. X
  2397. X    * selectable read timeout
  2398. X
  2399. X    * read poll
  2400. X
  2401. X    * carrier lost handling
  2402. X
  2403. X    General:
  2404. X
  2405. X    (1) Use Level 1 I/O if you can (read/write)
  2406. X        read() returns 0 on timeout, -1 on carrier lost
  2407. X        otherwise, read() returns the immediate number of
  2408. X        data bytes ready up to the amount you requested.
  2409. X        (i.e. if you read(0,buf,256) you can get anywhere from
  2410. X        -1, 0, 1 to 256 back).
  2411. X
  2412. X        write() returns the number you wrote or -1 (lost carrier)
  2413. X
  2414. X        To 'poll' data ready you can read(0, NULL, 0) .. reading
  2415. X        0 bytes returns 0 (data ready) or -1 (data not ready).
  2416. X        NOTE: 0 (data ready) will be returned if carrier is lost
  2417. X        when you read 0 bytes... this is so your program thinks
  2418. X        data is ready and when it does a real read it finds that
  2419. X        carrier was lost!
  2420. X
  2421. X    (2) If you want to use Level 2 I/O (stdio) I suggest you use
  2422. X        it for writing only.  If you really want to use it for
  2423. X        reading remember that the timeout will cause an EOF
  2424. X        condition which must be cleared (clrerr()).  And you
  2425. X        must call ferror() to determine whether an EOF is an
  2426. X        EOF (timeout()) or an actual error (lost carrier).
  2427. X
  2428. X    REFER TO UUSERDUMP.C for a working source example.
  2429. X
  2430. X
  2431. END_OF_FILE
  2432. if test 2039 -ne `wc -c <'src/uuser/uuser.doc'`; then
  2433.     echo shar: \"'src/uuser/uuser.doc'\" unpacked with wrong size!
  2434. fi
  2435. # end of 'src/uuser/uuser.doc'
  2436. fi
  2437. echo shar: End of archive 2 \(of 16\).
  2438. cp /dev/null ark2isdone
  2439. MISSING=""
  2440. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  2441.     if test ! -f ark${I}isdone ; then
  2442.     MISSING="${MISSING} ${I}"
  2443.     fi
  2444. done
  2445. if test "${MISSING}" = "" ; then
  2446.     echo You have unpacked all 16 archives.
  2447.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2448. else
  2449.     echo You still need to unpack the following archives:
  2450.     echo "        " ${MISSING}
  2451. fi
  2452. ##  End of shell archive.
  2453. exit 0
  2454. -- 
  2455. Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to:
  2456.     amiga@cs.odu.edu    
  2457. or    amiga@xanth.cs.odu.edu    ( obsolescent mailers may need this address )
  2458. or    ...!uunet!xanth!amiga    ( very obsolescent mailers need this address )
  2459.  
  2460. Comments, questions, and suggestions should be addressed to ``amiga-request''
  2461. (please only use ``amiga'' for actual submissions) at the above addresses.
  2462.